use dataset_anes, clear

keep if white == 1

collapse flip* votedem [aw=weight], by(year)

#delimit;

gr tw
	(con flipdemrep year, col(black) msym(O))
	(con fliprepdem year, col(gray) msym(s))
	,
		legend(off)
		plotregion(style(none))
		xtitle("Year")
		xlab(1952(4)2016, angle(45))
		ytitle("Proportion of ANES respondents")
		ylab(, angle(horiz))
		text(0.16 2000 "Flipped R{&rarr}D", col(gray))
		text(0.25 1976 "Flipped D{&rarr}R", col(black))		
		;

#delimit cr

gr export "figure 2.pdf", replace
